3.138 \(\int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^3} \, dx\)

Optimal. Leaf size=141 \[ -\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2} \]

[Out]

5/32*x/a^3+1/16*I*a/d/(a+I*a*tan(d*x+c))^4+1/12*I/d/(a+I*a*tan(d*x+c))^3+3/32*I/a/d/(a+I*a*tan(d*x+c))^2-1/32*
I/d/(a^3-I*a^3*tan(d*x+c))+1/8*I/d/(a^3+I*a^3*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ -\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^3,x]

[Out]

(5*x)/(32*a^3) + ((I/16)*a)/(d*(a + I*a*Tan[c + d*x])^4) + (I/12)/(d*(a + I*a*Tan[c + d*x])^3) + ((3*I)/32)/(a
*d*(a + I*a*Tan[c + d*x])^2) - (I/32)/(d*(a^3 - I*a^3*Tan[c + d*x])) + (I/8)/(d*(a^3 + I*a^3*Tan[c + d*x]))

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^3} \, dx &=-\frac {\left (i a^3\right ) \operatorname {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^5} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \operatorname {Subst}\left (\int \left (\frac {1}{32 a^5 (a-x)^2}+\frac {1}{4 a^2 (a+x)^5}+\frac {1}{4 a^3 (a+x)^4}+\frac {3}{16 a^4 (a+x)^3}+\frac {1}{8 a^5 (a+x)^2}+\frac {5}{32 a^5 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2}-\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {(5 i) \operatorname {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{32 a^2 d}\\ &=\frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2}-\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.30, size = 115, normalized size = 0.82 \[ \frac {\sec ^3(c+d x) (-60 i \sin (c+d x)-120 d x \sin (3 (c+d x))+20 i \sin (3 (c+d x))+15 i \sin (5 (c+d x))-180 \cos (c+d x)+20 i (6 d x+i) \cos (3 (c+d x))+9 \cos (5 (c+d x)))}{768 a^3 d (\tan (c+d x)-i)^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^3,x]

[Out]

(Sec[c + d*x]^3*(-180*Cos[c + d*x] + (20*I)*(I + 6*d*x)*Cos[3*(c + d*x)] + 9*Cos[5*(c + d*x)] - (60*I)*Sin[c +
 d*x] + (20*I)*Sin[3*(c + d*x)] - 120*d*x*Sin[3*(c + d*x)] + (15*I)*Sin[5*(c + d*x)]))/(768*a^3*d*(-I + Tan[c
+ d*x])^3)

________________________________________________________________________________________

fricas [A]  time = 0.55, size = 76, normalized size = 0.54 \[ \frac {{\left (120 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 12 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 120 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 60 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 20 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{768 \, a^{3} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/768*(120*d*x*e^(8*I*d*x + 8*I*c) - 12*I*e^(10*I*d*x + 10*I*c) + 120*I*e^(6*I*d*x + 6*I*c) + 60*I*e^(4*I*d*x
+ 4*I*c) + 20*I*e^(2*I*d*x + 2*I*c) + 3*I)*e^(-8*I*d*x - 8*I*c)/(a^3*d)

________________________________________________________________________________________

giac [A]  time = 1.74, size = 119, normalized size = 0.84 \[ -\frac {-\frac {60 i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a^{3}} + \frac {60 i \, \log \left (-i \, \tan \left (d x + c\right ) - 1\right )}{a^{3}} - \frac {12 \, {\left (5 \, \tan \left (d x + c\right ) + 7 i\right )}}{a^{3} {\left (i \, \tan \left (d x + c\right ) - 1\right )}} + \frac {-125 i \, \tan \left (d x + c\right )^{4} - 596 \, \tan \left (d x + c\right )^{3} + 1110 i \, \tan \left (d x + c\right )^{2} + 996 \, \tan \left (d x + c\right ) - 405 i}{a^{3} {\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{768 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/768*(-60*I*log(-I*tan(d*x + c) + 1)/a^3 + 60*I*log(-I*tan(d*x + c) - 1)/a^3 - 12*(5*tan(d*x + c) + 7*I)/(a^
3*(I*tan(d*x + c) - 1)) + (-125*I*tan(d*x + c)^4 - 596*tan(d*x + c)^3 + 1110*I*tan(d*x + c)^2 + 996*tan(d*x +
c) - 405*I)/(a^3*(tan(d*x + c) - I)^4))/d

________________________________________________________________________________________

maple [A]  time = 0.41, size = 137, normalized size = 0.97 \[ \frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{64 d \,a^{3}}+\frac {1}{32 a^{3} d \left (\tan \left (d x +c \right )+i\right )}-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{64 a^{3} d}+\frac {i}{16 a^{3} d \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {3 i}{32 d \,a^{3} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 d \,a^{3} \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {1}{8 a^{3} d \left (\tan \left (d x +c \right )-i\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^3,x)

[Out]

5/64*I/a^3/d*ln(tan(d*x+c)+I)+1/32/a^3/d/(tan(d*x+c)+I)-5/64*I/a^3/d*ln(tan(d*x+c)-I)+1/16*I/a^3/d/(tan(d*x+c)
-I)^4-3/32*I/a^3/d/(tan(d*x+c)-I)^2-1/12/d/a^3/(tan(d*x+c)-I)^3+1/8/a^3/d/(tan(d*x+c)-I)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 3.68, size = 124, normalized size = 0.88 \[ \frac {5\,x}{32\,a^3}+\frac {\frac {1}{3\,a^3}+\frac {35\,{\mathrm {tan}\left (c+d\,x\right )}^2}{96\,a^3}-\frac {5\,{\mathrm {tan}\left (c+d\,x\right )}^4}{32\,a^3}+\frac {\mathrm {tan}\left (c+d\,x\right )\,5{}\mathrm {i}}{32\,a^3}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,15{}\mathrm {i}}{32\,a^3}}{d\,\left (-{\mathrm {tan}\left (c+d\,x\right )}^5+{\mathrm {tan}\left (c+d\,x\right )}^4\,3{}\mathrm {i}+2\,{\mathrm {tan}\left (c+d\,x\right )}^3+{\mathrm {tan}\left (c+d\,x\right )}^2\,2{}\mathrm {i}+3\,\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2/(a + a*tan(c + d*x)*1i)^3,x)

[Out]

(5*x)/(32*a^3) + ((tan(c + d*x)*5i)/(32*a^3) + 1/(3*a^3) + (35*tan(c + d*x)^2)/(96*a^3) + (tan(c + d*x)^3*15i)
/(32*a^3) - (5*tan(c + d*x)^4)/(32*a^3))/(d*(3*tan(c + d*x) + tan(c + d*x)^2*2i + 2*tan(c + d*x)^3 + tan(c + d
*x)^4*3i - tan(c + d*x)^5 - 1i))

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 228, normalized size = 1.62 \[ \begin {cases} - \frac {\left (100663296 i a^{12} d^{4} e^{22 i c} e^{2 i d x} - 1006632960 i a^{12} d^{4} e^{18 i c} e^{- 2 i d x} - 503316480 i a^{12} d^{4} e^{16 i c} e^{- 4 i d x} - 167772160 i a^{12} d^{4} e^{14 i c} e^{- 6 i d x} - 25165824 i a^{12} d^{4} e^{12 i c} e^{- 8 i d x}\right ) e^{- 20 i c}}{6442450944 a^{15} d^{5}} & \text {for}\: 6442450944 a^{15} d^{5} e^{20 i c} \neq 0 \\x \left (\frac {\left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 8 i c}}{32 a^{3}} - \frac {5}{32 a^{3}}\right ) & \text {otherwise} \end {cases} + \frac {5 x}{32 a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2/(a+I*a*tan(d*x+c))**3,x)

[Out]

Piecewise((-(100663296*I*a**12*d**4*exp(22*I*c)*exp(2*I*d*x) - 1006632960*I*a**12*d**4*exp(18*I*c)*exp(-2*I*d*
x) - 503316480*I*a**12*d**4*exp(16*I*c)*exp(-4*I*d*x) - 167772160*I*a**12*d**4*exp(14*I*c)*exp(-6*I*d*x) - 251
65824*I*a**12*d**4*exp(12*I*c)*exp(-8*I*d*x))*exp(-20*I*c)/(6442450944*a**15*d**5), Ne(6442450944*a**15*d**5*e
xp(20*I*c), 0)), (x*((exp(10*I*c) + 5*exp(8*I*c) + 10*exp(6*I*c) + 10*exp(4*I*c) + 5*exp(2*I*c) + 1)*exp(-8*I*
c)/(32*a**3) - 5/(32*a**3)), True)) + 5*x/(32*a**3)

________________________________________________________________________________________